<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../../../inc/conn.asp"-->
<!--#include file="../common/u.asp"-->
<%links="funds"

'分页-------------------------------------------------------
set Rs=server.CreateObject("ADODB.RecordSet")
sql="select count(sortid) from (Select ROW_NUMBER() OVER (order by id desc) as sortid,* From funds) as TempTable where 1=1 and uid='"&uid&"'"
Pager_Pagesize=20 '每页记录数
Rs.open sql,conn,1,1
Pager_TotalRecord=Rs(0) '总记录数
Rs.close
Pager_PageCount=int((Pager_TotalRecord/Pager_Pagesize)+0.99999) '计算总页数
CurrentPage=Request("page") '当前页
if isnumeric(CurrentPage)=false then CurrentPage=1
if CurrentPage=0 then CurrentPage=1
if CurrentPage="" then CurrentPage=1
'如果不为数字则直接设置页码为1
if isnumeric(CurrentPage)=False Or CurrentPage="" then
	CurrentPage=1
'如果当前页数大于总页数，则直接设置页码为1
elseif  Clng(CurrentPage)>Pager_PageCount then
	CurrentPage=1
end if
Fieldsname=" [Id],[Uid],[Money],[Balance],[Content],[Type],[PayType],[Mark],[Addtime],sortid"
orderBy=" Order by sortid asc"
'拆分SQL语句，必须是select开头，有唯一标识的列
if instr("select",sql)<>-1 then
	if CurrentPage = 1 then
		sql = replace(sql,"select count(sortid)"," select  top " & Pager_Pagesize  & Fieldsname)
	else  
		sql = replace(sql,"select count(sortid)"," select  top " & Pager_Pagesize   & Fieldsname) & " and sortid >(select max(sortid) from (" & replace(sql,"select count(sortid)"," select  top " & Pager_Pagesize * (CurrentPage - 1)  & Fieldsname) & orderBy & ") AA)"
	end if
end if
sql = sql & orderBy
Rs.open sql,conn,1,1


  '分页 
  UrlView="/user/funds?"
  if CurrentPage<=1 then
  pageview="<a class='disabled'> < </a>"
  else
  pageview="<a href='"&UrlView&"page="&CurrentPage-1&"'> < </a>"
  end if
  if CurrentPage>=7 then
  pageview=pageview+"<a href='"&UrlView&"page=1'>1</a><a>...</a>"
  end if
  if Pager_PageCount<4 then NumPage=Pager_PageCount else NumPage=4
  for tp = -4 to NumPage
  if Pager_PageCount>=tp+CurrentPage and tp+CurrentPage=>1  then 
  if trim(tp+CurrentPage)=CurrentPage or tp=0 then
  pageview=pageview+"<a class='cur_page'>"&tp+CurrentPage&"</a>"
  else
  pageview=pageview+"<a"&pagecss&" href='"&UrlView&"page="&tp+CurrentPage&"'>"&tp+CurrentPage&"</a>"
  end if
  end if
  next
  if Pager_PageCount>tp+CurrentPage then pageview=pageview+"<a>...</a>"
  if Pager_PageCount<CurrentPage+1 then
  pageview=pageview+"<a class='disabled'> > </a>"
  else
  pageview=pageview+"<a href='"&UrlView&"page="&CurrentPage+1&"'> > </a>"
  end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>资金明细</title>
<link href="favicon.ico" rel="shortcut icon" type="image/x-icon"/>
<link rel="stylesheet" type="text/css" href="/css/style.css" />
<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/jquery.tabs.js"></script>
</head>
<body>




<!--#include file="../../common/top.asp"-->





<div class="fullwidth">
	<div class="place ">
		<a href="/">首页</a> &gt; <a href="/user">会员中心</a> &gt; 资金明细
	</div>
</div>
<!--main-->
<div class="fullwidth bg1">
	<div class="main">
		
		
        
        
        <!--#include file="../common/left.asp"-->
        
        
		
		<div class="right_show f_r">
			
			<div class="title_4">
				<h2>资金明细</h2><div></div>
			</div>
			<div class="reg_box reg_s_1 account order_tab order_tab_3">
				<ul class="tab_menu">
					<li class="current">账户余额明细</li>
					<li><a href="/user/funds/point">积分明细</a></li>
				</ul>
				<div class="tab_box">
					<div>
						<div class="clear20"></div>
						<div class="clear20"></div>
						
						<p>账户余额：<font class="red"><%=money%>RMB</font></p>
						<div class="clear20"></div>
						<table class="stable stable_1 stable_2 stable_4">
							<tr>
								<th>日期</th>
								<th>收支（元）</th>
								<th>结算方式</th>
								<th>用途</th>
								<th>状态</th>
								<th>账户余额（元）</th>
							</tr>
                            <%do while not Rs.eof%>
							<tr>
								<td><%=rs("addtime")%></td>
								<td><font class="fgreen"><%=rs("money")%>RMB</font></td>
								<td>
								<%
								select case rs("PayType")
								case 0: response.write("支付宝")
								case 1: response.write("网银")
								case 2: response.write("系统操作")
								case 3: response.write("银行转账")
								end select
								%>
                                </td>
								<td>
                                <%
								select case rs("Type")
								case 0: response.write("充值")
								case 1: response.write("消费")
								case 2: response.write("提现")
								case 3: response.write("退款")
								case 4: response.write("信用保证金")
								end select
								%>
                                </td>
								<td><%if rs("mark")=true then response.Write "成功" else response.Write "<font color='red'>失败</font>"%></td>
								<td><%=rs("Balance")%>RMB</td>
							</tr>
                            <%
							Rs.movenext
							loop
							Rs.close
							Set Rs=nothing
							%>
							
						</table>
            <div class="clear20"></div>
						<div class="clear20"></div>
					</div>
					
					<div class="page">
							<%=pageview%>
						</div>
					
				</div>
				<div class="clear20"></div>
				<div class="clear20"></div>
			</div>	
			
		</div>
		
		
	</div>
</div>

<div class="clear"></div>



<!--#include file="../../common/footer.asp"-->



</body>
</html>